package org.zsk.cfl.service;


import org.flowable.engine.runtime.ProcessInstance;

import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * 流程服务类
 */
public interface IFlowService {

    /**
     * 部署工作流
     * @param bpmnXMLName bpmn20的xml名称
     * @return
     */
    Map<String,Object> createFlow(String bpmnXMLName,String deploymentName);

    /**
     * 启动工作流
     * @param processKey
     * @param paras
     * @return
     */
    ProcessInstance startFlow(String processKey, Map<String,Object> paras);

    /**
     * 判断流程是否结束
     * @param processInstanceId 流程实例id
     * @return 是否结束结果
     */
    boolean isFinished(String processInstanceId);

    /**
     * 浏览流程图
     * @param httpServletResponse
     * @param processId
     */
    void genProcessDiagram(HttpServletResponse httpServletResponse, String processId);

    /**
     * 完成任务
     * @param taskId
     * @param paras
     */
    void completeTask(String taskId, Map<String, Object> paras);
}

